alter table defect add DUTY varchar(5000) null
go
alter table defect add TEAM varchar(500) null
go
alter table defect_type add DEPARTMENT1_ID int null
go
update defect_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = 'HSE管理处' ) where DEFECT_TYPE = '安全环保'
go
update defect_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = '生产调度处' ) where DEFECT_TYPE = '生产'
go
update defect_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = '设备动力处' ) where DEFECT_TYPE = '设备'
go
update defect_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = '技术质量处' ) where DEFECT_TYPE = '工艺'
go

alter table tendency add DUTY varchar(5000) null
go
alter table tendency add TEAM varchar(500) null
go
alter table tendency_type add DEPARTMENT1_ID int null
go
update tendency_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = '生产调度处' ) where TENDENCY_TYPE = '生产'
go
update tendency_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = '技术质量处' ) where TENDENCY_TYPE = '工艺技术'
go
update tendency_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = '设备动力处' ) where TENDENCY_TYPE = '设备'
go
update tendency_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = '保卫处' ) where TENDENCY_TYPE = '交通'
go
update tendency_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = '消防支队' ) where TENDENCY_TYPE = '火灾爆炸'
go
update tendency_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = 'HSE管理处' ) where TENDENCY_TYPE = '放射'
go
update tendency_type set DEPARTMENT1_ID = (select ID from department1 where DEPARTMENT1_NAME = 'HSE管理处' ) where TENDENCY_TYPE = '人身伤害'
go
